<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up()
    {
        Schema::create('other_infos', function (Blueprint $table) {
            $table->increments('id')->comment('id');
            $table->string('unique_no', 100)->default('')->comment('唯一值');
            $table->string('user_id', 100)->default('')->comment('用户id');
            $table->string('user_name', 100)->default('')->comment('用户名称');
            $table->string('title', 100)->default('')->comment('用户标题');
            $table->text('details')->nullable()->comment('详情');
            $table->string('state', 10)->default('0')->comment('状态:1=正常;2=已完成;3=已关闭');
            $table->string('remark', 100)->default('')->comment('备注');
            $table->integer('weight')->default(0)->comment('权重');
            $table->dateTime('created_at')->default(DB::raw('CURRENT_TIMESTAMP'))->comment('创建时间');
            $table->dateTime('updated_at')->default(DB::raw('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'))->comment('更新时间');
            $table->dateTime('deleted_at')->nullable()->comment('删除时间');
        });
    }

    public function down()
    {
        Schema::dropIfExists('other_infos');
    }
}; 